package com.boot.unity.api.sql.upgrade.Runner;


import com.boot.unity.api.sql.upgrade.dao.SqlDao;
import lombok.AllArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@AllArgsConstructor
public class LoadTimeRunner {
    private SqlDao sqlDao;
    /**
     * 更新执行视图
     */
//    @Scheduled(fixedRate = 24*60*60*1000)
    public void studentSyncSchedule(){
        System.out.println("----------------------------开始执行运行的SQL语句了--------------------------------");
//        sqlDao.c_view_v_sex();



        /*sqlDao.c_view_v_xying();
        sqlDao.c_view_v_pay_province_training_time();
        sqlDao.c_view_v_full_today_time();*/
    }


//    @Scheduled(fixedRate = 60*1000)
    public void showAllView(){
        System.out.println("----------------------------显示数据库中所有的视图 开始--------------------------------");
        /*List<String> list = sqlDao.showAllVeiws();
        int i = 1;
        for(String view:list){
            System.out.println(i+":"+view);
            ++i;
        }*/
        System.out.println("----------------------------显示数据库中所有的视图 结束--------------------------------");
    }

    // 更新图片路径
    @Scheduled(fixedRate = 24*60*60*1000)
    public void coachPicUrl(){
        sqlDao.updateDeptImg();
//        sqlDao.updateCoachPic();
//        sqlDao.updateManagerPic();
//        sqlDao.updateAd();
    }


}
